Open
Conversation
This commit adds the AGENTS.md file, which contains guidelines for contributing to the project. This includes information on project structure, build and test commands, coding style, testing guidelines, and commit/pull request guidelines.
Introduces a flake.nix file to manage the development environment for libansilove using Nix Flakes. This includes defining packages and a development shell with necessary build tools and libraries.
This commit introduces the `flake.lock` file, which pins the exact versions of the dependencies used by the Nix flake. This ensures reproducible builds by locking down the revisions of `nixpkgs`, `flake-utils`, and `nix-systems`.
Updates the flake.nix to use the `gd` package instead of the deprecated `libgd`. Also conditionally adds `gdb` for non-Darwin systems and `lldb` for Darwin systems.
Include commands for entering the dev shell, building, and checking the flake. Also add a note about updating the flake.lock file.
There was a problem hiding this comment.
Pull Request Overview
This PR adds Nix development tooling to streamline contributor onboarding and provide reproducible build environments. The changes introduce a complete Nix flake configuration that packages libansilove and provides a development shell with all necessary dependencies.
Key changes:
- Adds Nix flake configuration for building libansilove and providing development environment
- Documents repository conventions and automation guidelines for contributors
- Provides direnv integration for automatic environment loading
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| flake.nix | Complete Nix flake with package definition and dev shell configuration |
| AGENTS.md | Comprehensive repository guidelines covering build, test, coding style, and PR conventions |
| CLAUDE.md | Single-line file containing "AGENTS.md" |
| .envrc | Direnv configuration to auto-load the Nix flake |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| flake-utils.lib.eachDefaultSystem ( | ||
| system: let | ||
| pkgs = import nixpkgs {inherit system;}; | ||
| version = "1.4.2"; |
There was a problem hiding this comment.
The version is hardcoded in the flake. Consider extracting this from CMakeLists.txt or another authoritative source to avoid version drift between the build system and the Nix package.
Suggested change
| version = "1.4.2"; | |
| # Extract version from CMakeLists.txt | |
| version = let | |
| cmakeContents = builtins.readFile ./CMakeLists.txt; | |
| matches = builtins.match ''set *\( *PROJECT_VERSION +([0-9]+\.[0-9]+\.[0-9]+) *\)'' cmakeContents; | |
| in if matches != null && matches != [] then builtins.elemAt matches 0 else throw "Could not extract version from CMakeLists.txt"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add Nix flake and contributor automation.
Summary
AGENTS.mdso future helpers know the repository conventions up front.envrcto auto-load the Nix flake for contributors who opt into direnvflake.nix+flake.lockpairing that builds libansilove and exposes a dev shell with clang and the right debugger per platform.gitignoreso the flake'sresult*outputs and direnv state never pollute commitsWhy keep the flake in-tree?
mkdir build && cmake .. && makepath; the flake is additive and kept tidy via.gitignore.Testing
nix develop --command echo oknix buildnix flake check --all-systems